package utils;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;

import config.AppConfig;

/**
 * Created by zhaoshengping on 2017/2/28.
 */

public abstract class QrColor {

    private String [] colors;
    private Context mContext;
    public QrColor (Context context) {
        this.colors = AppConfig.COLOR_STRING_ARR;
        this.mContext = context;
    }

    public void AlertColorChoose (int currentColor) {
        AlertDialog.Builder color_alert = new AlertDialog.Builder(mContext);
        color_alert.setTitle("选择颜色");
        color_alert.setSingleChoiceItems(this.colors, currentColor, new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                itemClick(dialogInterface,i);
            }
        });

        color_alert.create().show();
    }

    public abstract void itemClick(DialogInterface dialogInterface, int i);
}
